package com.yunshipei.inter.JsInterface;

import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.webkit.JavascriptInterface;

import com.yunshipei.utils.BaseUtil;
import io.rong.eventbus.EventBus;

public class HomeSearchJsObject {

    private Context context;
    private Handler handler;

    public HomeSearchJsObject(Context context) {
        this.context = context;
        this.handler = new Handler(Looper.getMainLooper());
    }

    @org.xwalk.core.JavascriptInterface
    public void cancelSearch() {
        handler.post(new Runnable() {
            @Override
            public void run() {
                BaseUtil.hideKeyBoard(context);
                ((Activity) context).finish();
            }
        });
    }
}
